﻿ <%@ Page Title="" Language="C#" MasterPageFile="~/eGrocery.Master" AutoEventWireup="true" CodeBehind="CityMaster.aspx.cs" Inherits="eGrocery.Web.Masters.WebForm1"  %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 <ContentTemplate>
<table width="100%">
   <%-- <tr>
        <td>
            <asp:GridView ID="grdCity" runat="server"></asp:GridView>
        </td>
    </tr>
    <tr>
        <td></td>
    </tr>
    <tr>        
        <td colspan="2"><asp:Button id="btnSave" runat="server" Text="Save" 
                onclick="btnSave_Click" Width="68px" />
                <asp:Button id="btnDelete" runat="server" Text="Delete" 
                Width="68px" onclick="btnDelete_Click" /></td>
    </tr>--%>

    <tr>
    <td width="20%"></td>
    <td width="60%">
    <div style="border:2px solid silver;height:400px">
    <table width="100%" style="font-family:Verdana">
    <tr><td colspan="2">
    <div style="height:30px;background-color:black;">
    <span style="color:White;font-family:Verdana;font-size:20px; font-weight:bold">
   <center> City Master</center>
    </span>
    </div>
    </td></tr>
     <tr><td colspan="2">
    <div style="height:30px;background-color:black">
    <span style="color:White;font-family:Verdana">
    Add New:
    </span>
    </div>
    </td></tr>
    <tr>
    <td>City Name:</td>
    <td>
    <asp:TextBox id="txtCityName" runat="server" Width="300px" Height="20px"  ></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>City Display Name:</td>
    <td>
    <asp:TextBox id="txtCityDisplayName" runat="server" Width="300px" Height="20px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>State Name:</td>
    <td>
    <asp:DropDownList id="ddlStateName" runat="server" Width="300px" Height="25px"></asp:DropDownList>
    </td>
    </tr>
    <tr>
    <td align="center" colspan="2"><asp:Button ID ="btnAdd" runat="server" Text="Add" OnClick="btnSave_Click" Width="60px" Height="25px" />
     <asp:Button ID ="btnCancel" runat="server" Text="Cancel" Width="60px" 
            Height="25px" onclick="btnCancel_Click" />
   <asp:Button ID ="btnDelete" runat="server" Text="Delete" Width="60px" Height="25px"  Enabled="false"/></td>
    </tr>
         <tr><td colspan="2" style="height:40px">
   
   
    </td></tr>
         <tr><td colspan="2">
    <div style="height:30px;background-color:black">
    <span style="color:White;font-family:Verdana">
    Cities Added Yet:
    </span>
    </div>
    </td></tr>
    
         <tr><td colspan="2" align="center">
           <asp:GridView ID="grdCity" runat="server" EmptyDataText="No Data Available" AutoGenerateColumns="false" Width="400px">
           <Columns>
           <asp:TemplateField HeaderText= "Full Name">
          
           <ItemTemplate>
           <asp:Label ID="lblCityFullName" runat="server" Text='<%#Eval("FULL_NAME") %>'></asp:Label>
           </ItemTemplate>
           </asp:TemplateField>
           <asp:TemplateField HeaderText= "Display Name">
           <ItemTemplate>
           <asp:Label ID="lblCityDisplayName" runat="server" Text='<%#Eval("DISPLAY_NAME") %>'></asp:Label>
           </ItemTemplate>
           </asp:TemplateField>
            <asp:TemplateField>
           <ItemTemplate>
           <asp:LinkButton ID="lnkModify" runat="server" Text="Modify" Font-Underline="false"  CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
           </ItemTemplate>
           </asp:TemplateField>
           </Columns>
           </asp:GridView>
      
    </td></tr>

    </table>
    </div>
    </td>
    <td width="20%"></td>
    </tr>
</table>
<asp:Panel ID="pnlEditCity" runat="server" Width="400px" Height="300px">
<table>

 <tr>
    <td>City Name:</td>
    <td>
    <asp:TextBox id="txtECityName" runat="server" Width="300px" Height="20px"></asp:TextBox>
    </td>
     
    </tr>
    <tr>
    <td>City Display Name:</td>
    <td>
    <asp:TextBox id="txtECityDisplayname" runat="server" Width="300px" Height="20px"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>State Name:</td>
    <td>
    <asp:DropDownList id="ddlEStates" runat="server" Width="300px" Height="25px"></asp:DropDownList>
    </td>
    </tr>
    <tr>
    <td align="center" colspan="2">
    <asp:Button ID ="btnModify" runat="server" Text="Add"  Width="60px" Height="25px" />
     <asp:Button ID ="btnMCancel" runat="server" Text="Cancel" Width="60px" Height="25px" />
   <asp:Button ID ="btnMdelete" runat="server" Text="Delete" Width="60px" Height="25px"  Enabled="false"/></td>
    </tr>
</table>
</asp:Panel>


<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"  PopupControlID="pnlEditCity"
    BackgroundCssClass="modalBackground"
    TargetControlID="lnkModify" 
    DropShadow="true" 
    OkControlID="btnModify" 
    OnOkScript=""
    CancelControlID="btnMCancel">
        <Animations>
           
        </Animations>
     </asp:ModalPopupExtender>

      <asp:LinkButton ID="lnkModify" runat="server" Text="Modify" Visible="false" ></asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
